package main

import (
	"fmt"
	"log"
	"time"

	"alipayDmp/jobs"
	"alipayDmp/mysql"
	"github.com/robfig/cron/v3"
)

func main() {
	// 加载中国时区
	location, err := time.LoadLocation("Asia/Shanghai")
	if err != nil {
		fmt.Println("Error loading location:", err)
		return
	}

	// 设置全局时区
	time.Local = location

	log.Println(time.Now().AddDate(0, 2, 0).Format("2006-01-02 00:00:00"))

	mysql.Init()

	c := cron.New(cron.WithSeconds())

	c.AddFunc("0 1 6 * * *", func() {
		jobs.BaiDuJob()
	})

	c.Start()

	log.Println("项目已启动-", len(c.Entries()))

	select {}
}
